/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.qjs.smterp.model;

import java.util.Date;
import java.util.Set;

import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Vostro 3400
 */
@Entity
@Table(name = "tb_instock")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Instock.findAll", query = "SELECT i FROM Instock i"),
    @NamedQuery(name = "Instock.findByInstockId", query = "SELECT i FROM Instock i WHERE i.instockId = :instockId"),
    @NamedQuery(name = "Instock.findByInstockCode", query = "SELECT i FROM Instock i WHERE i.instockCode = :instockCode")})
public class Instock extends BasePojo {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "INSTOCK_ID")
    private Integer instockId;
	
    @Basic(optional = false)
    @Column(name = "INSTOCK_CODE")
    private String instockCode;
    @Column(name = "DOC_CODE")
    private String docCode;
    @Column(name = "INSTOCK_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date instockDate;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "GRAND_TOTAL")
    private Float grandTotal;
    @Column(name = "BYWORDS_GRAND_TOTAL")
    private String bywordsGrandTotal;
    @Column(name = "NOTE")
    private String note;

    @Column(name = "FORMER_ID")
    private Integer former;
    
    @Column(name = "FORMER_NAME")
    private String formerName;
    @Column(name = "DELIVERY_BY")
    private String deliveryBy;
    
    
    @Column(name = "STOREKEEPER_ID")
	private Integer storekeeper;
    
    @Column(name = "STOREKEEPER_NAME")
    private String storekeeperName;
    

	@Column(name = "CHIEF_ACC_ID")
    private Integer chiefAcc;
    
    @Column(name = "CHIEF_ACC_NAME")
    private String chiefAccName;
    
    
    @OneToMany(cascade = CascadeType.ALL)
    @JoinColumn(name="INSTOCK_ID")
    private Set<GoodsInstock> goodsInstock;

    public Instock() {
    }

    public Instock(Integer instockId) {
        this.instockId = instockId;
    }

    public Instock(Integer instockId, String instockCode) {
        this.instockId = instockId;
        this.instockCode = instockCode;
    }

    public Integer getInstockId() {
        return instockId;
    }

    public void setInstockId(Integer instockId) {
        this.instockId = instockId;
    }

    public String getInstockCode() {
        return instockCode;
    }

    public void setInstockCode(String instockCode) {
        this.instockCode = instockCode;
    }

    public String getDocCode() {
        return docCode;
    }

    public void setDocCode(String docCode) {
        this.docCode = docCode;
    }

    public Date getInstockDate() {
        return instockDate;
    }

    public void setInstockDate(Date instockDate) {
        this.instockDate = instockDate;
    }

    public Float getGrandTotal() {
        return grandTotal;
    }

    public void setGrandTotal(Float grandTotal) {
        this.grandTotal = grandTotal;
    }

    public String getBywordsGrandTotal() {
        return bywordsGrandTotal;
    }

    public void setBywordsGrandTotal(String bywordsGrandTotal) {
        this.bywordsGrandTotal = bywordsGrandTotal;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }



    public String getFormerName() {
        return formerName;
    }

    public void setFormerName(String formerName) {
        this.formerName = formerName;
    }

    public String getDeliveryBy() {
        return deliveryBy;
    }

    public void setDeliveryBy(String deliveryBy) {
        this.deliveryBy = deliveryBy;
    }

 

    public String getStorekeeperName() {
        return storekeeperName;
    }

    public void setStorekeeperName(String storekeeperName) {
        this.storekeeperName = storekeeperName;
    }

   

    public String getChiefAccName() {
        return chiefAccName;
    }

    public void setChiefAccName(String chiefAccName) {
        this.chiefAccName = chiefAccName;
    }

    

	public Integer getFormer() {
		return former;
	}

	public void setFormer(Integer former) {
		this.former = former;
	}

	

	public Integer getStorekeeper() {
		return storekeeper;
	}

	public void setStorekeeper(Integer storekeeper) {
		this.storekeeper = storekeeper;
	}

	public Integer getChiefAcc() {
		return chiefAcc;
	}

	public void setChiefAcc(Integer chiefAcc) {
		this.chiefAcc = chiefAcc;
	}

	public Set<GoodsInstock> getGoodsInstock() {
		return goodsInstock;
	}

	public void setGoodsInstock(Set<GoodsInstock> goodsInstock) {
		this.goodsInstock = goodsInstock;
	}

	@Override
    public int hashCode() {
        int hash = 0;
        hash += (instockId != null ? instockId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Instock)) {
            return false;
        }
        Instock other = (Instock) object;
        if ((this.instockId == null && other.instockId != null) || (this.instockId != null && !this.instockId.equals(other.instockId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.qjs.smterp.model.Instock[ instockId=" + instockId + " ]";
    }
    
}
